import request from '@/config/axios'

// 机构公告 VO
export interface NoticeInfoVO {
  id: number // 公告编号
  title: string // 公告标题
  source: string // 来源
  content: string // 公告内容
}

// 机构公告 API
export const NoticeInfoApi = {
  // 查询机构公告分页
  getNoticeInfoPage: async (params: any) => {
    return await request.get({ url: `/dbit/notice-info/page`, params })
  },

  // 查询机构公告详情
  getNoticeInfo: async (id: number) => {
    return await request.get({ url: `/dbit/notice-info/get?id=` + id })
  },

  // 新增机构公告
  createNoticeInfo: async (data: NoticeInfoVO) => {
    return await request.post({ url: `/dbit/notice-info/create`, data })
  },

  // 修改机构公告
  updateNoticeInfo: async (data: NoticeInfoVO) => {
    return await request.put({ url: `/dbit/notice-info/update`, data })
  },

  // 删除机构公告
  deleteNoticeInfo: async (id: number) => {
    return await request.delete({ url: `/dbit/notice-info/delete?id=` + id })
  },

  // 导出机构公告 Excel
  exportNoticeInfo: async (params) => {
    return await request.download({ url: `/dbit/notice-info/export-excel`, params })
  },
}